Component({
  properties: {
    list: {
      type: Array,
      value: []
    },
    subed: {
      type: Boolean
    }
  },
  methods: {
    onClick(e) {
      let dataset = e.currentTarget.dataset;
      let topic = dataset.topic;
      console.log('选中知识点');
      console.log(topic);
      if (!(topic.free || topic.textbookSubscribed)) {
        wx.showToast({
          title: '您尚未订阅对应课程',
          icon: 'none',
          duration: 2000
        })
        return;
      }
      topic.index = dataset.index;
      topic.type = 'topic';
      this.triggerEvent('topicTap', topic);
    }
  }
})